﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Prices
{
    class Prices
    {
        static void Main()
        {
            Product pro = new Product("neshto", 12);
            pro.PriceIncreased +=new PriceIncreasedEventHandler(PriceIncreased);
            pro.Price = 2;
            pro.Price = 5;
            pro.PriceIncreased -= new PriceIncreasedEventHandler(PriceIncreased);
            pro.Price = 8;
        }

        private static void PriceIncreased(object sender, PriceIncreasedEventArgs eventArgs)
        {
            Console.WriteLine("The price has increased from {0} to {1}",eventArgs.OldPrice, eventArgs.NewPrice);
        }
    }
}
